package proyecto.testcasetool.provider.main;

import java.util.Collection;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;

import proyecto.testcasetool.provider.ActorItemProvider;

public class ActorItemProviderWithoutChildren extends ActorItemProvider {

	public ActorItemProviderWithoutChildren(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	@Override
	public Collection<?> getChildren(Object object) {
		return null;
	}
	
	@Override
	public boolean hasChildren(Object object) {
		return false;
	}
	
	@Override
	public Collection<?> getNewChildDescriptors(Object object,
			EditingDomain editingDomain, Object sibling) {
		return null;
	}
	
	@Override
	public Object getParent(Object object) {
		Object useCaseModel = super.getParent(object);
		UseCaseModelItemProviderMain useCaseModelItemProviderMain =
		(UseCaseModelItemProviderMain)adapterFactory.adapt(
		useCaseModel, IEditingDomainItemProvider.class);
		return useCaseModelItemProviderMain != null ?
				useCaseModelItemProviderMain.getActors() : null;
	}
	
}
